package com.longai.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Enroll entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "enroll", catalog = "longai")
public class Enroll implements java.io.Serializable {

	// Fields

	private Integer enrollId;
	private User user;
	private Event event;

	// Constructors

	/** default constructor */
	public Enroll() {
	}

	/** full constructor */
	public Enroll(User user, Event event) {
		this.user = user;
		this.event = event;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "enroll_id", unique = true, nullable = false)
	public Integer getEnrollId() {
		return this.enrollId;
	}

	public void setEnrollId(Integer enrollId) {
		this.enrollId = enrollId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "user_id")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "event_id")
	public Event getEvent() {
		return this.event;
	}

	public void setEvent(Event event) {
		this.event = event;
	}

}